import service from '@/utils/request';

export interface ListParams {
  noticeTitle?: string;
  createBy?: string;
  businessType?: string;
  beginTime?: string;
  endTime?: string;
}
// 查询公告列表
export function getListData(params: ListParams) {
  return service.request({
    url: '/system/notice/list',
    method: 'get',
    params,
  });
}

// 查询公告详细
export function getNotice(noticeId: string) {
  return service.request({
    url: `/system/notice/${noticeId}`,
    method: 'get',
  });
}

// 新增公告
export function addNotice(data: any) {
  return service.request({
    url: '/system/notice',
    method: 'post',
    data,
  });
}

// 修改公告
export function updateNotice(data: any) {
  return service.request({
    url: '/system/notice',
    method: 'put',
    data,
  });
}

// 删除公告
export function delNotice(noticeId: string) {
  return service.request({
    url: `/system/notice/${noticeId}`,
    method: 'delete',
  });
}
